package com.songyl.controller;

import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import com.songyl.common.ret.RetMsg;

import java.util.Map;

@Controller
@CrossOrigin(origins = "*")
public class HelloController {


    /**
     * bak.songyl.com 首页
     * @param map
     * @return
     */
    @ApiOperation(value = "bak.songyl.com 首页",notes = "bak.songyl.com 首页路径")
    @GetMapping("/")
    public String index(ModelMap map) {

        map.put("ret_msg","songyl.com");
        return "index";
    }

    /**
     * bak.songyl.com 首页
     * @param map
     * @return
     */
    @ApiOperation(value = "bak.songyl.com 首页",notes = "bak.songyl.com 首页路径")
    @PostMapping("/hello")
    public @ResponseBody
    RetMsg hello(@RequestBody  Map map) {
        map.put("ret_msg","bak.songyl.com");
        RetMsg retMsg = new RetMsg();
        retMsg.setCode("0");
        retMsg.setData(map);

        return retMsg;
    }


    
}
